package com.artifact.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.artifact.dao.SoftInfoDao;
import com.artifact.model.SoftInfo;

@Repository("softInfoDao")
public class SoftInfoDaoImpl implements SoftInfoDao {
	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public SoftInfo getSoftInfo(String name) {
		String sql = "select * from soft_info where name = ?";
		try {
			return jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<SoftInfo>(SoftInfo.class), name);
		} catch (Exception e) {
			return null;
		}
	}

}
